home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
catn
/
pack-old.n
< prev
next >
Wrap
Text File
|
1994-09-20
|
10KB
|
265 lines
pack-old(n) Tk Commands
_________________________________________________________________
NAME
pack - Obsolete syntax for packer geometry manager
SYNOPSIS
pack after _s_i_b_l_i_n_g _w_i_n_d_o_w _o_p_t_i_o_n_s ?_w_i_n_d_o_w _o_p_t_i_o_n_s ...?
pack append _p_a_r_e_n_t _w_i_n_d_o_w _o_p_t_i_o_n_s ?_w_i_n_d_o_w _o_p_t_i_o_n_s ...?
pack before _s_i_b_l_i_n_g _w_i_n_d_o_w _o_p_t_i_o_n_s ?_w_i_n_d_o_w _o_p_t_i_o_n_s ...?
pack info _p_a_r_e_n_t
pack unpack _w_i_n_d_o_w
_________________________________________________________________
DESCRIPTION
_N_o_t_e: _t_h_i_s _m_a_n_u_a_l _e_n_t_r_y _d_e_s_c_r_i_b_e_s _t_h_e _s_y_n_t_a_x _f_o_r _t_h_e pack
_c_o_m_m_a_n_d _a_s _i_t _b_e_f_o_r_e _T_k _v_e_r_s_i_o_n _3._3. _A_l_t_h_o_u_g_h _t_h_i_s _s_y_n_t_a_x
_c_o_n_t_i_n_u_e_s _t_o _b_e _s_u_p_p_o_r_t_e_d _f_o_r _b_a_c_k_w_a_r_d _c_o_m_p_a_t_i_b_i_l_i_t_y, _i_t _i_s
_o_b_s_o_l_e_t_e _a_n_d _s_h_o_u_l_d _n_o_t _b_e _u_s_e_d _a_n_y_m_o_r_e. _A_t _s_o_m_e _p_o_i_n_t _i_n
_t_h_e _f_u_t_u_r_e _i_t _m_a_y _c_e_a_s_e _t_o _b_e _s_u_p_p_o_r_t_e_d.
The packer is a geometry manager that arranges the children
of a parent by packing them in order around the edges of the
parent. The first child is placed against one side of the
window, occupying the entire span of the window along that
side. This reduces the space remaining for other children
as if the side had been moved in by the size of the first
child. Then the next child is placed against one side of
the remaining cavity, and so on until all children have been
placed or there is no space left in the cavity.
The before, after, and append forms of the pack command are
used to insert one or more children into the packing order
for their parent. The before form inserts the children
before window _s_i_b_l_i_n_g in the order; all of the other win-
dows must be siblings of _s_i_b_l_i_n_g. The after form inserts
the windows after _s_i_b_l_i_n_g, and the append form appends one
or more windows to the end of the packing order for _p_a_r_e_n_t.
If a _w_i_n_d_o_w named in any of these commands is already packed
in its parent, it is removed from its current position in
the packing order and repositioned as indicated by the com-
mand. All of these commands return an empty string as
result.
The unpack form of the pack command removes _w_i_n_d_o_w from the |
packing order of its parent and unmaps it. After the execu- |
tion of this command the packer will no longer manage |
_w_i_n_d_o_w's geometry.
Tk 1
pack-old(n) Tk Commands
The placement of each child is actually a four-step process;
the _o_p_t_i_o_n_s argument following each _w_i_n_d_o_w consists of a
list of one or more fields that govern the placement of that
window. In the discussion below, the term _c_a_v_i_t_y refers to
the space left in a parent when a particular child is placed
(i.e. all the space that wasn't claimed by earlier children
in the packing order). The term _p_a_r_c_e_l refers to the space
allocated to a particular child; this is not necessarily
the same as the child window's final geometry.
The first step in placing a child is to determine which side
of the cavity it will lie against. Any one of the following
options may be used to specify a side:
top Position the child's parcel against the top of the cav-
ity, occupying the full width of the cavity.
bottom
Position the child's parcel against the bottom of the
cavity, occupying the full width of the cavity.
left Position the child's parcel against the left side of
the cavity, occupying the full height of the cavity.
right
Position the child's parcel against the right side of
the cavity, occupying the full height of the cavity.
At most one of these options should be specified for any
given window. If no side is specified, then the default is
top.
The second step is to decide on a parcel for the child. For
top and bottom windows, the desired parcel width is normally
the cavity width and the desired parcel height is the
window's requested height, as passed to Tk_GeometryRequest.
For left and right windows, the desired parcel height is
normally the cavity height and the desired width is the
window's requested width. However, extra space may be
requested for the window using any of the following options:
padx _n_u_m Add _n_u_m pixels to the window's requested width
before computing the parcel size as described
above.
pady _n_u_m Add _n_u_m pixels to the window's requested height
before computing the parcel size as described
above.
expand This option requests that the window's parcel
absorb any extra space left over in the parent's
cavity after packing all the children. The
Tk 2
pack-old(n) Tk Commands
amount of space left over depends on the sizes
requested by the other children, and may be
zero. If several windows have all specified
expand then the extra width will be divided
equally among all the left and right windows
that specified expand and the extra height will
be divided equally among all the top and bottom
windows that specified expand.
If the desired width or height for a parcel is larger than
the corresponding dimension of the cavity, then the cavity's
dimension is used instead.
The third step in placing the window is to decide on the
window's width and height. The default is for the window to
receive either its requested width and height or the those
of the parcel, whichever is smaller. If the parcel is
larger than the window's requested size, then the following
options may be used to expand the window to partially or
completely fill the parcel:
fill Set the window's size to equal the parcel size.
fillx
Increase the window's width to equal the parcel's
width, but retain the window's requested height.
filly
Increase the window's height to equal the parcel's
height, but retain the window's requested width.
The last step is to decide the window's location within its
parcel. If the window's size equals the parcel's size, then
the window simply fills the entire parcel. If the parcel is
larger than the window, then one of the following options
may be used to specify where the window should be positioned
within its parcel:
frame center Center the window in its parcel. This is the
default if no framing option is specified.
frame n Position the window with its top edge cen-
tered on the top edge of the parcel.
frame ne Position the window with its upper-right
corner at the upper-right corner of the par-
cel.
frame e Position the window with its right edge cen-
tered on the right edge of the parcel.
frame se Position the window with its lower-right
Tk 3
pack-old(n) Tk Commands
corner at the lower-right corner of the par-
cel.
frame s Position the window with its bottom edge cen-
tered on the bottom edge of the parcel.
frame sw Position the window with its lower-left
corner at the lower-left corner of the par-
cel.
frame w Position the window with its left edge cen-
tered on the left edge of the parcel.
frame nw Position the window with its upper-left
corner at the upper-left corner of the par-
cel.
The pack info command may be used to retrieve information
about the packing order for a parent. It returns a list in
the form
_w_i_n_d_o_w _o_p_t_i_o_n_s _w_i_n_d_o_w _o_p_t_i_o_n_s ...
Each _w_i_n_d_o_w is a name of a window packed in _p_a_r_e_n_t, and the
following _o_p_t_i_o_n_s describes all of the options for that win-
dow, just as they would be typed to pack append. The order
of the list is the same as the packing order for _p_a_r_e_n_t.
The packer manages the mapped/unmapped state of all the
packed children windows. It automatically maps the windows
when it packs them, and it unmaps any windows for which
there was no space left in the cavity.
The packer makes geometry requests on behalf of the parent
windows it manages. For each parent window it requests a
size large enough to accommodate all the options specified
by all the packed children, such that zero space would be
leftover for expand options.
KEYWORDS
geometry manager, location, packer, parcel, size
Tk 4